<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>流程定义管理</title>
    <!-- 公共CSS,JS文件 -->
    <#include "../common/header.ftl"/>
</head>
<body>
<div class="container-fluid">
    <!-- 左右侧导航 -->
    <div class="row">
        <!-- 右侧导航 -->
        <div class="col-xs-12">
            <div class="panel">
                <div class="panel-heading">
                    <ol class="breadcrumb" style="margin-bottom: 2px;">
                        <li>首页</li>
                        <li>工作流管理</li>
                        <li>流程定义管理</li>
                        <div style="float: right; padding-bottom: 5px;"><a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="icon icon-refresh"></i></a></div>
                    </ol>
                </div>
                <!-- 流程图片modal -->
                <div class="modal fade" id="imgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title">查看流程图</h4>
                            </div>
                            <div class="modal-body">
                                <img id="ImagePic" src="">
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 节点处理人设置modal -->
                <div class="modal fade" id="nodeModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title">设置流程节点</h4>
                            </div>
                            <div class="modal-body">
                                设置流程节点
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 上传文件modal -->
                <div class="modal fade" id="updateFileModal" tabindex="-1" role="dialog" aria-labelledby="myUpdateFileModal" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title">上传模型</h4>
                            </div>
                            <div class="modal-body">
                                <div class="uploader" id="uploaderExample">
                                    <div class="uploader-message">
                                        <div class="content"></div>
                                        <button type="button" class="close">×</button>
                                    </div>
                                    <div class="uploader-files file-list"
                                         data-drag-placeholder="请拖拽文件到此处"></div>
                                    <div class="uploader-actions">
                                        <div class="uploader-status pull-right text-muted"></div>
                                        <button type="button" class="btn btn-link uploader-btn-browse">
                                            <i class="icon icon-plus"></i> 选择文件
                                        </button>
                                        <button type="button" class="btn btn-link uploader-btn-start">
                                            <i class="icon icon-cloud-upload"></i> 开始上传
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <#--内容-->
                <div class="panel-body">
                    <div id="toolbar" class="toolbox btn-group" style="padding-top:10px; padding-bottom:10px;">
                    <#--<@shiro.hasPermission name="admin:role:add">-->
                        <button class="btn btn-warning" onclick="updateNode()"><i class="icon icon-upload"></i>流程部署</button>
                    <#--</@shiro.hasPermission>-->
                    </div>
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th><input type="checkbox" onclick="checkBox('ids',this.checked)"/></th>
                            <#--<th>编号</th>-->
                            <th>流程定义ID</th>
                            <th>流程定义名称</th>
                            <th>流程定义的Key</th>
                            <th>流程定义的版本</th>
                            <th>资源名称bpmn文件</th>
                            <th>资源名称png文件</th>
                            <th>部署对象ID</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                            <#if processDefinitionList??>
                                <#list processDefinitionList as processDefinition>
                                    <tr>
                                        <th><input type="checkbox" class="checked_detect" value="${processDefinition.id! }" name="ids"/></th>
                                        <#--<th>${processDefinition_index+1!}</th>-->
                                        <th>${processDefinition.id!}</th>
                                        <th>${processDefinition.name!}</th>
                                        <th>${processDefinition.key!}</th>
                                        <th>${processDefinition.version!}</th>
                                        <th>${processDefinition.resourceName!}</th>
                                        <th>${processDefinition.diagramResourceName!}</th>
                                        <th>${processDefinition.deploymentId!}</th>
                                        <th>
                                            <button class="btn btn-success" onclick="startNode('${processDefinition.id! }')">启动</button>
                                            <#--<button class="btn btn-info" onclick="viewNode('${processDefinition.deploymentId! }')">查看流程图</button>
                                            <button class="btn btn-info" onclick="optSetNode('${processDefinition.deploymentId! }')">节点处理人设置</button>-->
                                            <button class="btn btn-danger" onclick="deleteNode('${processDefinition.id! }')">删除</button>
                                        </th>
                                    </tr>
                                </#list>
                            </#if>
                        </tbody>
                    </table>
                    <!-- 分页 start -->
                    <#--<#include "../../admin/common/page.ftl"/>-->
                    <!-- 分页 end -->
                </div>
            </div>
        </div>
    </div>
<#include "../common/footer.ftl"/>
</div>
<#--导入processDefinitionList.js文件-->
<script src="/static/zui/js/workflow/processDefinitionList.js"></script>
</body>
</html>